import shutil, os
from glob import glob

azws = glob("*/*.azw")
print("azws:\n", azws)
for azw in azws:
    try:
        shutil.copy(azw, f"./calibre")
    except Exception as e:
        print(f"copy Error: {azw} ")

file_startswith_B0 = glob("B0*")
for file in file_startswith_B0:
    if "." in file:
        os.remove(file)
    try:
        shutil.rmtree(file)
    except Exception as e:
        print(f"remove error: {file}, ***close kindle app***")

# os.system("pause")
